package com.hellloop.pim.alphabeat.gui;

import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.event.*;

import javax.swing.*;

import com.hellloop.pim.alphabeat.game.PIMClientGame;

public class LivingRoom extends JPanel {

	private PIMClientGame pimClientGame;
	private AlphabeatUI ui;
	
	private JButton readyButton;
	
	// main panel
	private JPanel gamePropPanel, playListPanel, confirmPanel;
	
	// game properties panel
	private JTextArea tempGamePropArea;
	
	// player list panel
	private JTextArea tempPlayListArea;

	public LivingRoom(PIMClientGame pimClientGame, AlphabeatUI ui) {
		this.pimClientGame = pimClientGame;
		this.ui = ui;
		InitComponents();
	}
	
	private void InitComponents(){
		
		setLayout(new BorderLayout());
		
		gamePropPanel = new JPanel();
		add(gamePropPanel, BorderLayout.NORTH);

		playListPanel = new JPanel();
		add(playListPanel, BorderLayout.CENTER);
		
		confirmPanel = new JPanel();
		add(confirmPanel, BorderLayout.SOUTH);
		
		// add components to game properties panel
		tempGamePropArea = new JTextArea("", 10, 20);
		gamePropPanel.add(tempGamePropArea);
		
		// add components to player list panel
		tempPlayListArea = new JTextArea("", 10, 20);
		playListPanel.add(tempPlayListArea);
		
		// add components to confirm panel
		readyButton = new JButton("Ready");
		readyButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent arg0) {
				pimClientGame.myReady(true);
				pimClientGame.myGameStart();
			}			
		});
		confirmPanel.add(readyButton);
	}
	
}
